home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / daolibb / readme.txt < prev    next >
Encoding:
Text File  |  1999-04-16  |  20.8 KB  |  785 lines

  1. DaoLib 2.0 - A complete solution for real world database development.
  2.  
  3.  
  4. 1 - Enhancements in this version - Requirements - Getting started
  5. 2 - Introduction
  6. 3 - Core components
  7. 4 - Intermediate abstractions
  8. 5 - User interface components
  9. 6 - Tutorial and code samples
  10. 7 - Deployment
  11. 8 - Feedback - Support
  12. 9 - Reference
  13. 10 - How to purchase
  14.  
  15.  
  16.  
  17. 1 - Enhancements in this version - Requirements - Getting started
  18.  
  19.     This new version of DaoLib has been rebuilt over the wrapping classes
  20. for DAO provided by the #import directive of Visual C++ 6.0. This means that
  21. it makes extensive use of the built-in support for fundamental COM types and
  22. smart pointers. All this resulted in a more stable and compatible library.
  23.     Unzip the DaoLib file maintaining the directory structure (-d). This
  24. library requires Visual C++ 6.x installed on the development system. The 
  25. evaluation version is fully functional, with a limit of 10 controls per 
  26. dialog and an annoying reminder.
  27.  
  28.  
  29.  
  30. 2 - Introduction
  31.  
  32.     The power of the DAO interface for dealing with databases is an
  33. undeniable fact. It provides a fast and reliable mechanism for data 
  34. management of Access and other ISAM and ODBC databases. Though it was 
  35. engineered targeting scripting languages such as Visual Basic and VBA, it 
  36. provides a dual interface, which allows straightforward C and C++ handling of 
  37. its methods and properties.
  38.     
  39.     The C/C++ developer has several options:
  40.  
  41.     a) Deal with COM interfaces such as DAODatabase, DAORecordset and the 
  42. like using the OS built-in OLE support. This could be tedious and error prone, 
  43. since the developer has to deal with reference counting, object releasing and 
  44. other COM annoying aspects.
  45.  
  46.     b) Go up one level through a C++ proxy. Microsoft provides such a 
  47. proxy-wrapper in its DAO library. This library is rowset-oriented and provides 
  48. a valuable variable binding mechanism, but it is not the best solution for 
  49. handling record-oriented applications.
  50.  
  51.     c) Use some framework which integrates the database specifics with a 
  52. user interface management. MFC-DAO is an example of this approach. The problem 
  53. here is that the integration is best suited for a Doc/View architecture, and 
  54. it adds some complexity when dealing with dialog intensive applications.
  55.  
  56.     DaoLib was built with this three-level separation of concerns. It deals 
  57. with all the COM burden, such as exception handling, reference counting and 
  58. object lifespan. It provides a wrapper level you can access directly, and it 
  59. integrates to MFC with little overhead.
  60.  
  61.  
  62.  
  63. 3 - Core components
  64.  
  65.     The classes at this level are wrapped around DAO components. In 
  66. addition, you can use helper classes such as _bstr_t, _variant_t and 
  67. Currency, which encapsulate the BSTR, VARIANT and CURRENCY semantics, allowing 
  68. a very robust parameter handling. _com_error manages error handling, converting 
  69. COM error objects into C++ exceptions.
  70.  
  71.     The instantiation of Dao objects was simplified through smart 
  72. constructors, many of which take no arguments or a single string object. The 
  73. enumerator semantics is replaced by a simpler indexing mechanism. The use of 
  74. the 'property' Microsoft extension allows a 'VB-like' syntax in many cases: 
  75. using Variant indexes, you can refer to a specific field as:
  76.     FieldValue[0] or as: FieldValue["CustomerID"]
  77. In addition, the same property (if marked read/write) can be a left or right 
  78. value.
  79.  
  80.     These are the core components and their mapping to DAO components:
  81.  
  82.     _FieldPtr        DAOField
  83.     DaoRecordset        DAORecordset
  84.     DatabasePtr        DAODatabase
  85.     WorkspacePtr        DAOWorkspace
  86.     _DBEnginePtr        DAODBEngine
  87.     ParameterPtr        DAOParameter
  88.     _QueryDefPtr        DAOQueryDef
  89.     _TableDefPtr        DAOTableDef
  90.     _IndexPtr        DAOIndex
  91.     _UserPtr        DAOUser
  92.     _GroupPtr        DAOGroup
  93.     _RelationPtr        DAORelation
  94.     ConnectionPtr        DAOConnection
  95.     PropertyPtr        DAOProperty
  96.  
  97.     These are the helper classes and their COM counterparts:
  98.  
  99.     _bstr_t            BSTR
  100.     _variant_t        VARIANT
  101.     Currency        CURRENCY
  102.  
  103.     This has no counterparts:
  104.     
  105.     _com_error        Error handling through exception throwing.
  106.  
  107.  
  108.  
  109. 4 - Intermediate abstractions
  110.  
  111.     In order to connect database objects with user interface elements 
  112. such as controls, windows or dialogs, a couple of intermediate level 
  113. abstract classes must be added to the hierarchy. These are DaoWindow and 
  114. DaoControl. A windowing user interface element must inherit from DaoWindow 
  115. and a control element from DaoControl to have complete control of its 
  116. underlying database objects. They interact tightly with MFC transfer 
  117. mechanisms. 
  118.  
  119.  
  120.  
  121. 5 - User interface components
  122.  
  123.     DaoLib comes with several user interface components, but its open 
  124. architecture allows you to add your own custom components. The basic 
  125. components are:
  126.  
  127.     Windowing components:
  128.         
  129.         DaoDialog
  130.         DaoPropSheet
  131.         DaoPropPage
  132.  
  133.     Control components:
  134.         
  135.         DaoEdit
  136.         DaoCheck
  137.         DaoRadio
  138.         DaoGroup
  139.         DaoCombo
  140.         DaoListCtrl
  141.  
  142.     Complete components:
  143.         
  144.         ListDialog
  145.         
  146.     The windowing components are intended to be used as base classes of
  147. your dialog objects. You can create regular dialogs or property pages using 
  148. the ClassWizard and then replace the base class in the declaration and add
  149. the constructor arguments. ClassWizard will still recognize your class and 
  150. it even will use DaoDialog or DaoPropPage when adding base class references.
  151.  
  152.     The control classes can be used directly. Once again, you create 
  153. control objects with ClassWizard and then replace their declaration (you can 
  154. use the 'Replace' command if you have many controls). You can manage some 
  155. attributes of the controls at declaration time, such as enabling or writing 
  156. denial.
  157.  
  158.     DaoLib includes a powerful dialog-based component called ListDialog.
  159. It manages the display of Recordset objects through a list control, naming 
  160. each header column upon the field's name and formatting the data according 
  161. to each data type. In addition, it provides complete printing support for the
  162. list control's contents, sorting through column header clicking, keyboard 
  163. support (Insert for adding records, Delete for deleting, Enter for viewing),
  164. and a mouse driven context menu with those same functions.
  165.  
  166.  
  167.  
  168. 6 - Tutorial and code samples
  169.  
  170.     The use of the library does not require any special skill. If you use
  171. Visual C++ and feel comfortable with the ClassWizard, you can produce DaoLib 
  172. code immediately. The steps to follow are:
  173.  
  174.     1 - You can create a project without database support, or use an 
  175. existing project. Add DaoLib2.lib to the libraries in the project settings 
  176. (Link page). Map the include path accordingly (C/C++ - Preprocessor).
  177.  
  178.  
  179.     2 - In the declaration of your App class, add the core #include 
  180.  
  181. #include "resource.h"       // main symbols
  182.  
  183. becomes:
  184.  
  185. #include "resource.h"       // main symbols
  186. #include "bordao.h"
  187.  
  188.  
  189.     3 - In InitInstance, add the Database initialization:
  190.  
  191.     CMainFrame* pFrame = new CMainFrame;
  192.     m_pMainWnd = pFrame;
  193.  
  194. becomes:
  195.  
  196.     try {
  197.           OpenDatabase("mydata.mdb");    //full path here, unless same
  198.                         //directory as .EXE
  199.     }
  200.     catch(_com_error& e) {
  201.            Show(e);
  202.         return FALSE;
  203.     }
  204.  
  205.     CMainFrame* pFrame = new CMainFrame;
  206.     m_pMainWnd = pFrame;
  207.  
  208.  
  209.     4 - Create the appropiate dialog resource. Assign each control an ID
  210. that resembles the name of the field with which it is associated. You can 
  211. optionally add a Modify button (ID = 302). It must be the first in the 
  212. control creation order. You may also add a Enter button (ID = 301). It must 
  213. be non-visible, non-tabstop and marked as default button (unmark the OK 
  214. button).
  215.  
  216.  
  217.     5 - Open the ClassWizard and create the CDialog as usual. For each 
  218. control, assign a member variable (Category: Control) of the required type. 
  219. If you want to use the macros provided with DaoLib (recommended), give each 
  220. control the exact name of the corresponding field, prefixed with 'm_' (for a 
  221. field named CustomerID it should be m_CustomerID).
  222.     
  223.  
  224.     6 - Close the ClassWizard and go to the dialog's class declaration 
  225. (*.h file). Replace CDialog with CDaoDialog in the inheritance tag and add 
  226. two parameters to the constructor before the existing one:
  227.  
  228. class CMyDialog : public CDialog
  229. {
  230. // Construction
  231. public:
  232.     CMyDialog(CWnd* Parent = NULL);
  233.  
  234. becomes:
  235.  
  236. class CMyDialog : public CDaoDialog
  237. {
  238. // Construction
  239. public:
  240.     CMyDialog(LPCSTR s = 0, bool a = 0, CWnd* Parent = NULL);
  241.     
  242.  
  243.     7 - Replace the member control objects with the appropiate ones:
  244.  
  245. // Dialog Data
  246.     //{{AFX_DATA(CMyDialog)
  247.     enum { IDD = IDD_MYDIALOG };
  248.     CEdit    m_CustomerID;
  249.     CButton m_NewCustomer;
  250.  
  251. becomes:
  252.  
  253. // Dialog Data
  254.     //{{AFX_DATA(CMyDialog)
  255.     enum { IDD = IDD_MYDIALOG };
  256.     CDaoEdit    m_CustomerID;
  257.     CDaoCheck     m_NewCustomer;
  258.     
  259.  
  260.     8 - Go to the implementation file (*.cpp) and add the #includes you
  261. need before the declaration file #include. In this case:
  262.  
  263. #include "stdafx.h"
  264. #include "MyDialog.h"
  265.  
  266. becomes:
  267.  
  268. #include "stdafx.h"
  269. #include "DaoDialog.h"
  270. #include "DaoEdit.h"
  271. #include "DaoCheck.h"
  272. #include "MyDialog.h"
  273.  
  274.  
  275.     9 - Modify the constructor accordingly.
  276.  
  277. CMyDialog::CMyDialog(CWnd* pParent /*=NULL*/)
  278.     : CDialog(CMyDialog::IDD, pParent)
  279. {
  280.  
  281. becomes:
  282.  
  283. CMyDialog::CMyDialog(LPCSTR s, bool a, CWnd* pParent /*=NULL*/)
  284.     : CDaoDialog(CMyDialog::IDD, pParent, s, a)
  285. {
  286.  
  287.  
  288.     10 - In the body of the constructor, add the initialization macros.
  289.  
  290.     //}}AFX_DATA_INIT
  291. }
  292.  
  293. becomes:
  294.  
  295.     //}}AFX_DATA_INIT
  296.     DAOCONTROL(CustomerID);
  297.     DAOCONTROL(NewCustomer);
  298. }
  299.  
  300.  
  301.     11 - Replace CDialog in the message map macro with CDaoDialog
  302.  
  303. BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
  304.     //{{AFX_MSG_MAP(CMyDialog)
  305.  
  306. becomes:
  307.  
  308. BEGIN_MESSAGE_MAP(CMyDialog, CDaoDialog)
  309.     //{{AFX_MSG_MAP(CMyDialog)
  310.  
  311.  
  312.     12 - That's it. Now you can construct an instance of your dialog and
  313. execute it. This can be done from inside a menu response function:
  314.  
  315.     CString sql = "select * from Customers where CustomerID = 5477";
  316.     try {
  317.         CMyDialog Cust(sql);
  318.         Cust.DoModal();
  319.     }
  320.     catch(_com_error& e) {
  321.         Show(e, *this);
  322.         return;
  323.     }
  324.  
  325. or, for inserting a record:
  326.  
  327.     CString sql = "select * from Customers";
  328.     try {
  329.         CMyDialog Cust(sql, true);
  330.         Cust.DoModal();
  331.     }
  332.     catch(_com_error& e) {
  333.         Show(e, *this);
  334.         return;
  335.     }
  336.  
  337. or, if you want to use a ListCtrl:
  338.  
  339.     DaoRecordset rs;
  340.     try {
  341.         rs = "select * from Customers";
  342.     }
  343.     catch(_com_error& e) {
  344.         Show(e, *this);
  345.         return;
  346.     }
  347.     CMyDialog Cust;
  348.     CListDialog Lis(rs, &Cust);
  349.     Lis.SetCaption("Listing of Customers");
  350.     Lis.DoModal();
  351.  
  352.     Don't forget to #include the DaoLib specific headers in this file too, 
  353. before the dialog declaration #include. If you use the ListCtrl component, you 
  354. must add the corresponding resources from DaoLib.rc to your resource file.
  355.  
  356. #include "DaoDialog.h"
  357. #include "DaoEdit.h"
  358. #include "DaoCheck.h"
  359. #include "MyDialog.h"
  360. #include "ListDialog.h"    //if using ListDialog
  361.  
  362.     If you don't use all the functionality of DaoLib, the linker may issue
  363. warnings about not referencing some libraries: this is the normal behavior. 
  364. If you compile and link a Debug version, you can get some other warnings about
  365. conflicting libraries. The non-evaluation version of DaoLib comes with a 
  366. Debug static library and complete source code.
  367.  
  368.  
  369.     13 - The procedure for a property sheet is very similar. Take a look
  370. at the accompanying sample code.
  371.  
  372.  
  373.  
  374. 7 - Deployment
  375.  
  376.     Programs built using DaoLib need no additional dlls. Of course DAO is
  377. required. A DaoLib license allows unlimited deployment.
  378.  
  379.  
  380.  
  381. 8 - Feedback - Support
  382.  
  383.     This is not a Beta release: we at ARGSOFT use this library since 1996 
  384. (VC++ 4.2) for our custom products, and it only required some updating from 
  385. time to time. We are aware that other developers may have quite different 
  386. needs, so we will appreciate feedback. Please write to:
  387.  
  388.     feedback@argsoft.com
  389.  
  390.     ARGSOFT provides full support for the registered version. Evaluators
  391. may ask for support, and in most cases they will get it. Please write to:
  392.  
  393.     support@argsoft.com
  394.  
  395.  
  396.  
  397. 9 - Reference
  398.  
  399.     In order to avoid repetition, we don't reference methods and 
  400. properties of the core components that are documented in the DAO reference.
  401. Only those functions with extended functionality are mentioned. You can 
  402. browse header files for more information.
  403.  
  404. Core components:
  405.  
  406.  
  407. - DaoRecordset 
  408.  
  409. DaoRecordset();
  410.  
  411.     Default constructor
  412.  
  413. DaoRecordset(_bstr_t);
  414.  
  415.     Constructs a DaoRecordset object from a SQL string
  416.     
  417. DaoRecordset(DaoRecordset&);
  418.     
  419.     Copy constructor
  420.  
  421. DaoRecordset& operator=(_bstr_t);
  422.  
  423.     Assignment operator
  424.  
  425. - Globals
  426.  
  427. _variant_t getdate();        
  428.     
  429.     Retrieves current date/time
  430.  
  431. _bstr_t shortdate(_variant_t);    
  432.  
  433.     Returns date part
  434.  
  435.  
  436. Abstract base classes:
  437.  
  438. - DaoWindow 
  439.  
  440. DaoWindow(LPCSTR s = 0, bool a = false);
  441.     
  442.     Regular constructor. It takes a SQL string and an editing/adding condition.
  443.     
  444. DaoWindow(DaoRecordset& r, bool a = false);
  445.  
  446.     Constructor for child objects, taking an existing recordset.
  447.  
  448. bool alta;
  449.  
  450.     Attribute that determines if we are editing or adding a record.
  451.  
  452. virtual bool Execute() = 0;
  453.  
  454.     Mandatory execution method.
  455.     
  456. virtual bool Exec(char* sql, bool a = false);
  457.     
  458.     This method launches a dialog object from an external user interface.
  459.     
  460. virtual bool Baja(char* sql);
  461.  
  462.     Method for managing record deletion
  463.  
  464. - DaoControl 
  465.  
  466. virtual void Transfer(BOOL bSaveAndValidate) = 0;
  467.  
  468.     This forces derived classes to implement the transfer mechanism.
  469.  
  470. Variant index;
  471.  
  472.     Attribute for the field class. It can be a field name or a field index.
  473.  
  474. void DDX_Control(CDataExchange *pDX);
  475.  
  476.     Binding method. It manages collaboration between the GUI and database 
  477.     components.
  478.  
  479. DaoControl& operator=(Variant const &);
  480.  
  481.     Assignment operator. Each derived class must override this.
  482.     
  483. virtual void Enable(bool e = true) = 0;
  484.  
  485.     User interface enabling/disabling mandatory method.
  486.  
  487. Windowing user interface:
  488.  
  489. - CDaoDialog
  490.  
  491.     This class combines a regular CDialog with a DaoWindow interface. It
  492. trasparently manages several aspects of the user interface, such as 
  493. initialization of control objects, enabling of controls, update or insert of
  494. data and control navigation. 
  495.  
  496. bool cont;
  497.  
  498.     Attribute for controlling survival of the object after an OnOK event. 
  499.     Useful for continued data entry.
  500.  
  501. bool child;
  502.     
  503.     This condition is true if the object was created with the child
  504.     creation constructor.
  505.  
  506. CDaoDialog(UINT i, CWnd* p = 0, LPCSTR s = 0, bool a = false);
  507.  
  508.     Normal constructor. It takes the usual CDialog parameters plus a SQL
  509.     string and a insert/update flag.
  510.  
  511. CDaoDialog(UINT i, DaoRecordset& r, CWnd* p = 0, bool a = false);
  512.  
  513.     Child creation constructor. It references an existing DaoRecordset 
  514.     object.
  515.  
  516. virtual void OnOK();
  517.  
  518.     It manages inserting or updating data.
  519.  
  520. void SetCaption(LPCTSTR str);
  521.  
  522.     As name suggests.
  523.  
  524. bool Execute();
  525.  
  526.     Virtual execution member function.  Returns true if OK is pressed; 
  527.     false otherwise.
  528.  
  529. void SetModify(int Id, bool mod = true);
  530.  
  531.     Helper function for edit controls.
  532.  
  533. void SetDlgItemText(int nID, LPCTSTR lpszString);
  534.         
  535.     Override of the CWnd function. It sets the modify flag in edit 
  536.     controls.
  537.  
  538. virtual void OnModificar();        
  539.  
  540.     Manages enabling of controls.
  541.  
  542. virtual void OnEnter();            
  543.  
  544.     Moves focus among controls on each return.
  545.  
  546. - CDaoPropSheet
  547.  
  548.     Objects of this class, unlike CDaoDialog, can be used directly. It 
  549. adapts the functionality of CDaoDialog to property sheets.
  550.  
  551. CDaoPropSheet(LPCTSTR pszCaption = 0, LPCSTR s = 0, bool a = false, 
  552.     CWnd* pParentWnd = NULL);
  553.  
  554.     Constructor. Takes the normal CDaoPropertySheet parameters plus a SQL
  555.     string and an insert/update flag.
  556.  
  557. bool modif;
  558.  
  559.     Modification flag. It determines enabling of controls.
  560.  
  561. bool Execute();
  562.  
  563.     Virtual execution method. Returns true if OK is pressed; 
  564.     false otherwise.
  565.  
  566. - CDaoPropPage
  567.  
  568.     This is a base class for property pages linked to CDaoPropSheet 
  569. objects. In addition to the regular CDaoDialog features, it manages wizard
  570. interfaces for inserting new data.
  571.  
  572. CDaoPropPage(UINT resId);
  573.  
  574.     Constructor. It takes a resource identification.
  575.  
  576. bool GetModif() const;
  577.  
  578.     It returns the property sheet modification flag.
  579.  
  580. void SetModify(int Id,bool mod = true);
  581.  
  582.     Helper function for edit controls.
  583.  
  584. bool GetAlta() const;
  585.  
  586.     It returns the insert/update flag.
  587.  
  588. virtual void OnModificar();
  589.  
  590.     Manages enabling of controls.
  591.  
  592. Control components:
  593.  
  594. - CDaoCheck 
  595.  
  596.     This control binds to a checkbox and a boolean data field.
  597.  
  598. CDaoCheck& operator=(Variant const & v);
  599.  
  600.     Initialization method. It associates the Field object with an index.
  601.  
  602. void Enable(bool e = true);
  603.  
  604.     User interface enabling function.
  605.  
  606. friend void AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CDaoCheck& rControl);
  607.  
  608.     This global function overrides the regular DDX_Control function for
  609.     this kind of control.
  610.  
  611. - CDaoCombo
  612.  
  613.     This is a more complicated control: it manages a combo box related to 
  614. a recordset, usually from another table (lookup). It binds to an integer data 
  615. field in the master table.
  616.  
  617. void Init(_variant_t v, LPCSTR s);
  618.     
  619.     Initialization function. It takes an index for the Field component
  620.     and a SQL string for the DaoRecordset component.
  621.  
  622. void Enable(bool e = true);
  623.  
  624.     User interface enabling function.
  625.  
  626. bool Disabled;
  627.     
  628.     Setting this property disables the component.
  629.  
  630. friend void AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CDaoCombo& rControl);
  631.  
  632.     This global function overrides the regular DDX_Control function for
  633.     this kind of control.
  634.  
  635. - CDaoEdit 
  636.  
  637.     This control binds to an edit control and a data field of any type. 
  638. Data type conversion is made transparently.
  639.  
  640. CDaoEdit& operator=(Variant const &);
  641.  
  642.     Initialization method. It associates the Field object with an index.
  643.  
  644. void Enable(bool e = true);
  645.  
  646.     User interface enabling function.
  647.  
  648. bool ReadOnly;
  649.  
  650.     Setting this property avoids writing to the component.
  651.  
  652. friend void AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CDaoEdit& rControl);
  653.  
  654.     This global function overrides the regular DDX_Control function for
  655.     this kind of control.
  656.  
  657. - CDaoGroup
  658.  
  659.     This control binds to a group of automatic radio buttons and an integer 
  660. data field.
  661.  
  662. CDaoGroup& operator=(Variant const & v);
  663.  
  664.     Initialization method. It associates the Field object with an index.
  665.  
  666. void Enable(bool e = true);
  667.  
  668.     User interface enabling function.
  669.  
  670. friend void AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CDaoGroup& rControl);
  671.  
  672.     This global function overrides the regular DDX_Control function for
  673.     this kind of control.
  674.  
  675. - CDaoRadio 
  676.  
  677.     This is a simpler control, managing two auto radio buttons and binding
  678. to a boolean data field.
  679.  
  680. CDaoRadio& operator=(Variant const & v);
  681.  
  682.     Initialization method. It associates the Field object with an index.
  683.  
  684. void Enable(bool e = true);
  685.  
  686.     User interface enabling function.
  687.  
  688. friend void AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CDaoRadio& rControl);
  689.  
  690.     This global function overrides the regular DDX_Control function for
  691.     this kind of control.
  692.  
  693. - CDaoListCtrl
  694.  
  695.     This control binds to a list control and a DaoRecordset. In addition, it
  696. provides custom test drawing and interfacing to dialogs and property sheets
  697. for adding and editing data.
  698.  
  699. CDaoListCtrl(DaoRecordset& r);
  700.  
  701.     Constructor taking a DaoRecordset reference.
  702.  
  703. int Llenar();
  704.  
  705.     Filling function.
  706.  
  707. void Linea(int index);
  708.  
  709.     This function takes care of filling each row.
  710.  
  711. LPCSTR GetIndexText(int index);
  712.  
  713.     This retrieves the text of an item given its index. 
  714.  
  715. int Update(int index);
  716.  
  717.     Updating function.
  718.  
  719. Complete components:
  720.  
  721. - CListDialog 
  722.  
  723.     This dialog-based class displays the contents of an entire DaoRecordset.
  724. It formats columns according to the fields of the recordset.
  725.  
  726. CListDialog(DaoRecordset& r, DaoWindow* d = 0, CWnd* pParent = NULL);   
  727.     
  728.     Constructor. It takes a DaoRecordset reference and an optional DaoWindow
  729.     descendant, which it can open for inserting or modifying data.
  730.  
  731. void SetCaption(LPCSTR str);
  732.  
  733.     As name suggest.
  734.  
  735. int* lencol;
  736.  
  737.     Optional array of column lengths, for custom formatting.
  738.  
  739. int indcol;
  740.  
  741.     Optional index for the column used in the WHERE clause of the SQL
  742.     statement.
  743.  
  744. int* totcol;
  745.  
  746.     Optional array of column indexes. The component computes totals on
  747. these columns and show them at the bottom of the list, in each corresponding
  748. column.
  749.  
  750. CDaoListCtrl    m_Lista;
  751.  
  752.     The CDaoListCtrl member.
  753.  
  754. virtual void OnOK();
  755.  
  756.     If a DaoWindow descendant was specified on construction, the 
  757. component builds a SQL statement for the selected row and executes the dialog
  758. object.
  759.  
  760. afx_msg void OnImprimir();
  761.  
  762.     Prints the content of the list control.
  763.  
  764. Macros:
  765.  
  766. DAOCONTROL(fieldname)
  767.  
  768.     Initializes the control object. It is included normally in the window
  769. object's constructor.
  770.  
  771. DAOCOMBO(fieldname, tablename)
  772.  
  773.     Initializes a DaoCombo object. It takes as arguments the field name
  774. in the master table and the lookup table name.
  775.  
  776.  
  777.  
  778. 10 - How to purchase
  779.  
  780.     You can buy the full version of the library online from a secure 
  781. server. Go to http://argsoft.com and follow the 'How to order' link.
  782.  
  783.  
  784. Buenos Aires, April 1999.
  785.